import request from '../utils/request/server.js'
console.log('request:', request)

// 获取验证码
// export function getVerifyCodeData(params) {
//   return request.post(request.baseUrl + '/login/getVerifyCodeData')
// }

// // 登录
export function login(params) {
  return request.post(request.baseUrl + '/login', params)
}

// username + password 获取token
export function getToken(params) {
  return request.post(
    request.baseUrl + '/public/token.do?action=generateToken',
    params
  )
}

// 根据 username 获取 userId
export function getUserIdByUsername(username, ecafeToken) {
  return request.post(
    request.baseUrl +
      `/public/org/user.do?action=getByUsername&username=${username}&ecafeToken=${ecafeToken}`
  )
}

// getUser
// export function getUser(params) {
//   return request.post(request.baseUrl + '/login', params)
// }
